<?php
class Zendvn_Validate_PhoneNumber extends Zend_Validate_Abstract{
	
	const INVALID_FORMAT     = 'phoneNumberInvalidFormat';
	
	protected $_messageTemplates = array(
        	self::INVALID_FORMAT      => "Khong dung dinh dang so phone",
		);
	
 	public function isValid($value){
    	$pattern = '#^084-[0-9]{2}-[0-9]{2}\.[0-9]{6}$#';
    	//084-08-38.234567
    	if(preg_match($pattern,$value)!=1){
    		$this->_error('phoneNumberInvalidFormat');
    		return false;    		
    	}
    	
    	return true;
    	
    }
}